package com.ruoyi.parking.service.impl;

import java.util.Collections;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.parking.mapper.SmartParkingSpaceMapper;
import com.ruoyi.parking.domain.SmartParkingSpace;
import com.ruoyi.parking.service.ISmartParkingSpaceService;

/**
 * 停车位Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-21
 */
@Service
public class SmartParkingSpaceServiceImpl implements ISmartParkingSpaceService 
{
    @Autowired
    private SmartParkingSpaceMapper smartParkingSpaceMapper;

    /**
     * 查询停车位
     * 
     * @param scSpaceId 停车位主键
     * @return 停车位
     */
    @Override
    public SmartParkingSpace selectSmartParkingSpaceByScSpaceId(Integer scSpaceId)
    {
        return smartParkingSpaceMapper.selectSmartParkingSpaceByScSpaceId(scSpaceId);
    }

    /**
     * 查询停车位列表
     * 
     * @param smartParkingSpace 停车位
     * @return 停车位
     */
    @Override
    public List<SmartParkingSpace> selectSmartParkingSpaceList(SmartParkingSpace smartParkingSpace)
    {
        return smartParkingSpaceMapper.selectSmartParkingSpaceList(smartParkingSpace);
    }

    /**
     * 新增停车位
     * 
     * @param smartParkingSpace 停车位
     * @return 结果
     */
    @Override
    public int insertSmartParkingSpace(SmartParkingSpace smartParkingSpace)
    {
        return smartParkingSpaceMapper.insertSmartParkingSpace(smartParkingSpace);
    }

    /**
     * 修改停车位
     * 
     * @param smartParkingSpace 停车位
     * @return 结果
     */
    @Override
    public int updateSmartParkingSpace(SmartParkingSpace smartParkingSpace)
    {
        return smartParkingSpaceMapper.updateSmartParkingSpace(smartParkingSpace);
    }

    /**
     * 批量删除停车位
     * 
     * @param scSpaceIds 需要删除的停车位主键
     * @return 结果
     */
    @Override
    public int deleteSmartParkingSpaceByScSpaceIds(Integer[] scSpaceIds)
    {
        return smartParkingSpaceMapper.deleteSmartParkingSpaceByScSpaceIds(scSpaceIds);
    }

    /**
     * 删除停车位信息
     * 
     * @param scSpaceId 停车位主键
     * @return 结果
     */
    @Override
    public int deleteSmartParkingSpaceByScSpaceId(Integer scSpaceId)
    {
        return smartParkingSpaceMapper.deleteSmartParkingSpaceByScSpaceId(scSpaceId);
    }

    @Override
    public List<SmartParkingSpace> selectSmartParkingSpaceListByArea(Integer scAreaId) {
        return smartParkingSpaceMapper.selectSmartParkingSpaceListByArea(scAreaId);
    }

    @Override
    public List<SmartParkingSpace> selectSmartParkingSpaceByCar(String scLicensePlate) {
        return smartParkingSpaceMapper.selectSmartParkingSpaceByCar(scLicensePlate);
    }
}
